import request from '@/utils/request'
import { getToken } from '@/utils/token'
// 登录
export const userLoginAPI = ({ mobile, code }) => request({
  url: '/v1_0/authorizations',
  method: 'POST',
  data: {
    mobile,
    code
  }
})
// 获取用户频道,不登录为默认推荐的频道
export const getUserChannelAPI = () => request({
  url: '/v1_0/user/channels',
  headers: { Authorization: `Bearer ${getToken()}` }
})
// 获取文章新闻推荐
export const getArticleListAPI = (channel_id) => request({
  url: '/v1_0/articles',
  headers: { Authorization: `Bearer ${getToken()}` },
  params: {
    channel_id: channel_id,
    timestamp: new Date()
  }
})
export const getChannelListAPI = () => request({
  url: '/v1_0/channels'
})
